import request from '@/libs/http/index'
// list
export function getRoleApi(params) {
  return request({
    url: '/role',
    method: 'GET',
    params
  })
}

// create
export function addRoleApi(data) {
  return request({
    url: '/role',
    method: 'POST',
    data
  })
}

export function updateRoleApi(data) {
  return request({
    url: '/role',
    method: 'PATCH',
    data
  })
}

export function delRoleApi(id) {
  return request({
    url: `/role/${id}`,
    method: 'DELETE'
  })
}

export function detailRoleApi(id) {
  return request({
    url: `/role/${id}`,
    method: 'GET'
  })
}

export const tableHeader = [
  {
    label: '角色名称',
    prop: 'role_name'
  },
  {
    label: '角色权限标识',
    prop: 'permission'
  },
  {
    label: '角色状态',
    prop: 'status'
  },
  {
    label: '角色描述',
    prop: 'remark'
  },
  {
    label: '创建时间',
    prop: 'create_time'
  },
  {
    label: '操作',
    prop: 'action',
    width: 180,
    fixed: 'right'
  }
];
